package cn.com.twoke.easyproject.config.version;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.Mapping;

import java.lang.annotation.*;


/**
 * API 版本注解
 */
@Retention(RetentionPolicy.RUNTIME)
@Target({
        ElementType.TYPE,
        ElementType.METHOD
})
@Documented
@Mapping
public @interface ApiVersion {
    String value() default ApiVersion.DEFAULT_API_VERSION;

    ApiVersionType type() default ApiVersionType.STATIC;

    ApiVersionAccessPolicyEnum accessPolicy() default ApiVersionAccessPolicyEnum.SAME_VERSION_ACCESS;

    /**
     * 默认版本号：v1
     */
    String DEFAULT_API_VERSION = Version.V1;

}
